﻿/*****************************************************************//**
 *
 * @file   FITKHDF5Reader.h
 * @brief  HDF5文件读取， 继承自线程任务。
 * @author fulipeng (flipengqd@yeah.net)
 * @date   2024-05-30
 *
 *********************************************************************/
#ifndef __FITKABAQUSHDF5READER_H__
#define __FITKABAQUSHDF5READER_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITKAbaqusIOHDF5Interface.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Interface/FITKInterfaceIO/FITKAbstractHDF5Reader.h"

ForwardDeclarNS(Core, FITKAbstractDataObject);
ForwardDeclarNS(H5, Group);
ForwardDeclarNS(H5, DataType);

namespace IO
{
    /**
    * @brief HDF5文件读取
    * @author fulipeng (fulipengqd@yeah.net)
    * @date 2024-05-30
    */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5Reader : public FITKAbstractHDF5Reader
    {
    public:
        /**
         * @brief Construct a new FITKAbaqusHDF5Reader object
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        explicit FITKAbaqusHDF5Reader();

        virtual ~FITKAbaqusHDF5Reader();

        /**
         * @brief 重写run函数
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        void run() override;

        /**
         * @brief 打印控制台消息
         * @param[i] level 打印级别 1 normal 2 warning 3error
         * @param[i] str 数据
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        void consoleMessage(int level, const QString& str) override;

    protected:


    private:

        /**
         * @brief 读取算例数据
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        bool readDataCases();

        /**
         * @brief 读取作业数据
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        bool readJobs();

        /**
         * @brief 读取版本号
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        bool readVersion();

    private:
        /**
         * @brief 算例管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        AbaqusData::FITKDataCaseManager* _caseManager{};

        /**
         * @brief 作业管理器
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-30
         */
        AbaqusData::FITKJobManager* _jobManager{};
    };
}


#endif
